home *** CD-ROM | disk | FTP | other *** search
/ 17 Bit Software 6: Level 6 / 17 Bit - Level 6 (1998)(Epic Marketing)[!].iso / quartz / q0498.dms / q0498.adf / PGEN < prev    next >
Text File  |  1992-06-07  |  6KB  |  277 lines

  1. curdsk=1
  2. colour=1
  3. yyval=12
  4. skipdel=0
  5.  
  6. cpytitl:dc.b "Lockpick Fast Copier Request",0
  7. cpyques:dc.b "Do you need a copy of the original?",0
  8. copyrst:dc.b "Proceeding with Fast Copy of remaining disks...",0
  9.  
  10. frqtitl:dc.b "Move to destination path... ",0
  11. frqpath:ds.b 256,0
  12. renpath:ds.b 256,0
  13. frqname:ds.b 32,0
  14.  
  15. nxtdskm:dc.b "Copy disk "
  16. dskm1:    dc.b "00 of "
  17. dskm2:    dc.b "00?",0
  18. slash:    dc.b "/",0
  19. diskdf1:dc.b "DF",0
  20. diskdf2:dc.b "df",0
  21. num00:    dc.b "0"
  22. num03:    dc.b "3"
  23.  
  24. cmp hdonly,0,2,goto dofreq
  25. docopy=simplereq(cpytitl,cpyques)
  26. cmp docopy,0,0,goto dofreq
  27.  
  28. connect=drives()
  29. cmp connect,-1,0,goto byebye
  30. poke(fname+2,connect+48)
  31. poke(rename+2,connect+48)
  32. poke(remdsk+19,connect+48)
  33. poke(insdsk2+6,connect+48)
  34.  
  35. drivenum=fcopy(connect,0)
  36. cmp drivenum,0,-1,goto byebye
  37. goto fixdev
  38.  
  39. dofreq:    freturn=freq(frqtitl,frqpath,frqname,1)
  40.     cmp freturn,0,0,goto byebye
  41.  
  42. fixdev:    pathlen=strlen(frqpath)
  43.     cmp pathlen,0,0,goto cpynam
  44.  
  45.     pathlen=pathlen+frqpath-1
  46.     terminator=^pathlen>24
  47.     cmp terminator,58,0,goto cpynam1
  48.     cmp terminator,47,0,goto cpynam1
  49.     
  50.     strcat(frqpath,slash)
  51.  
  52. cpynam1:strcpy(renpath,frqpath)
  53.     strcat(frqpath,fname+4)
  54.     strcat(renpath,rename+4)
  55.     goto chkdf
  56.  
  57. cpynam:    strcat(frqpath,fname)
  58.     strcat(renpath,rename)
  59.     
  60. chkdf:    sc=memcmp(frqpath,diskdf1,2)
  61.     cmp sc,0,0,goto fixxx
  62.     sc=memcmp(frqpath,diskdf2,2)
  63.     cmp sc,0,2,goto start
  64.  
  65. fixxx:    sc=memcmp(frqpath+2,num00,1)
  66.     cmp sc,0,-1,goto start
  67.     sc=memcmp(frqpath+2,num03,1)
  68.     cmp sc,0,1,goto start
  69.  
  70.     drivenum=frqpath+2
  71.     drivenum=^drivenum>24
  72.     poke(remdsk+19,drivenum)
  73.     poke(insdsk2+6,drivenum)
  74.     drivenum=drivenum-48
  75.     connect=drivenum<16+drivenum
  76.     freturn=0
  77.  
  78.  
  79. exist:    dc.b "Patch file already exists!",0
  80. fnf:    dc.b "File not found!  Attempting Disk Scan...",0
  81. fnf1:    dc.b "File not found!",0
  82. pnf:    dc.b "Protection not found! Attempting Disk Scan!",0
  83. pnf1:    dc.b "Protection not found!",0
  84. pnf2:    dc.b "*** PARAMETER FAILED! ***",0
  85. worktxt:dc.b "Working, please stand by...",0
  86. clickany:dc.b "Click in this window to exit...",0
  87.  
  88. prof:    dc.b "*** Parameter Successful! ***",0
  89. remdsk:    dc.b "Remove disk from DF0: then click in this window...",0
  90.  
  91. insdsk:    dc.b "Insert BACKUP of",0
  92. insdsk2:dc.b " in DF0: then click in this window...",0
  93.     dc.w 0
  94.  
  95. oritab:    dc.l orig1,fix1,orig2,fix2,orig3,fix3,orig4,fix4,orig5,fix5
  96.     dc.l orig6,fix6,orig7,fix7,orig8,fix8,orig9,fix9
  97.     dc.l orig10,fix10,orig11,fix11,orig12,fix12,orig13,fix13
  98.     dc.l orig14,fix14,orig15,fix15,orig16,fix16,orig17,fix17
  99.     dc.l orig18,fix18,orig19,fix19,orig20,fix20,orig21,fix21
  100.     dc.l orig22,fix22,orig23,fix23,orig24,fix24,orig25,fix25
  101.     dc.l orig26,fix26,orig27,fix27,orig28,fix28,orig29,fix29
  102.     dc.l orig30,fix30,orig31,fix31,orig32,fix32,orig33,fix33
  103.     dc.l orig34,fix34,orig35,fix35,orig36,fix36,orig37,fix37
  104.     dc.l orig38,fix38,orig39,fix39,orig40,fix40,orig41,fix41
  105.     dc.l orig42,fix42,orig43,fix43,orig44,fix44,orig45,fix45
  106.     dc.l 0,0
  107.  
  108. * Open Window and print intro text...
  109. start:    cmp ^winname,"con:",0,winname=winname+18
  110.     pokel(wtitle,winname)
  111.     gosub openwin
  112.  
  113.     cmp docopy,1,0,goto main
  114.     cmp freturn,-1,0,goto main
  115.  
  116.     gosub remm
  117.     txtptr=insdsk
  118.     gosub print3d
  119.     txtptr=dname
  120.     colour=3
  121.     gosub print3d
  122.     txtptr=insdsk2
  123.     colour=1
  124.     gosub print3d
  125.  
  126.     gosub waitsgn
  127.     cmp class,$200000,2,goto chkclow
  128.     cmp code,$1b,0,goto remprta
  129. chkclow:cmp class,$200,0,goto remprta
  130.     skipdel=1
  131.  
  132. main:    txtptr=worktxt
  133.     gosub print3d
  134.     cmp skipdel,0,2,goto begit
  135.     cmp freturn,-1,0,goto begit
  136.     delay(100)
  137.  
  138. begit:    success=rename(frqpath,renpath)
  139.     cmp success,0,0,goto errexists
  140.     myhand=open(frqpath,1006)
  141.     cmp myhand,0,0,goto errexists
  142.     write(myhand,pst,pend-pst)
  143.     close(myhand)
  144.  
  145.     pos=0
  146.     pointer=oritab
  147.  
  148. looper:    orig=^pointer
  149.     pointer=pointer+4
  150.     fix=^pointer
  151.     pointer=pointer+4
  152.     pval=^pointer
  153.     cmp pval,0,0,top=garbage
  154.     cmp pval,0,2,top=pval
  155.  
  156. * Scan file for our string and replace if found...
  157.     pos=fscan(renpath,orig,fix-orig,fix,top-fix,pos)
  158.     cmp pos,-1,0,goto errpnf
  159.     cmp pos,-2,0,goto errfnf
  160.  
  161.     cmp pval,0,2,goto looper
  162.  
  163. itsok:    txtptr=prof
  164.     gosub print3d
  165.  
  166.     delay(100)
  167.     cmp note1,0,0,goto ky1
  168.     colour=3
  169.     txtptr=note1
  170.     gosub print3d
  171.     cmp note2,0,0,goto ky1
  172.     txtptr=note2
  173.     gosub print3d
  174.     cmp note3,0,0,goto ky1
  175.     txtptr=note3
  176.     gosub print3d
  177.  
  178. ky1:    cmp freturn,0,0,goto ky1a
  179.  
  180.     txtptr=clickany
  181.     gosub print3d
  182.     goto keyout
  183.  
  184. ky1a:    colour=1
  185.     yyval=yyval+10
  186.     txtptr=remdsk
  187.     gosub print3d
  188. ky2:    gosub remm
  189.     gosub waitsgn
  190.     cmp mess,0,0,goto ky2
  191.  
  192.     cmp numdsk,2,-1,goto bye0
  193.     yyval=yyval+10
  194.     txtptr=copyrst
  195.     gosub print3d
  196.     delay(50)
  197.  
  198. ky3:    curdsk=curdsk+1
  199.     cmp curdsk,numdsk,1,goto bye0
  200.     
  201.     tensv=curdsk/10&$ffff
  202.     onesv=tensv*10
  203.     onesv=curdsk-onesv
  204.     poke(dskm1,tensv+48)
  205.     poke(dskm1+1,onesv+48)
  206.  
  207.     tensv=numdsk/10&$ffff
  208.     onesv=tensv*10
  209.     onesv=numdsk-onesv
  210.     poke(dskm2,tensv+48)
  211.     poke(dskm2+1,onesv+48)
  212.  
  213.     docopy=simplereq(cpytitl,nxtdskm)
  214.     cmp docopy,1,-1,goto bye0
  215.     drivenum=fcopy(connect,-1)
  216.     cmp drivenum,0,-1,goto bye0
  217.     goto ky3
  218.  
  219. keyout:    gosub remm
  220.     gosub waitsgn
  221.     cmp mess,0,0,goto keyout
  222. bye0:    gosub closwin
  223. byebye:    end
  224.  
  225. errpnf:    cmp freturn,0,0,goto errp2
  226.  
  227.     txtptr=pnf1
  228.     gosub print3d
  229.     goto prii5a
  230.  
  231. errp2:    txtptr=pnf
  232.     gosub print3d
  233.     goto looper1
  234.  
  235. remprt:    delay(150)
  236.     cmp freturn,-1,0,goto bye0
  237. remprta:yyval=yyval+10
  238.     txtptr=remdsk
  239.     gosub print3d
  240.     goto keyout
  241.  
  242. errfnf:    cmp freturn,0,0,goto errf2
  243.  
  244.     txtptr=fnf1
  245.     gosub print3d
  246.     goto prii5a
  247.  
  248. errf2:    txtptr=fnf
  249.     gosub print3d
  250. looper1:pointer=oritab
  251. looper2:orig=^pointer
  252.     pointer=pointer+4
  253.     fix=^pointer
  254.     pointer=pointer+4
  255.     pval=^pointer
  256.     cmp pval,0,0,top=garbage
  257.     cmp pval,0,2,top=pval
  258.  
  259.     pos=dscan(drivenum,orig,fix-orig,fix,top-fix,0,1)
  260.     cmp pos,-2,0,goto prii5a
  261.     cmp pval,0,2,goto looper2
  262.     goto itsok
  263.  
  264. prii5a:    txtptr=pnf2
  265.     gosub print3d
  266.     goto remprt
  267.  
  268. errexists:myhand=open(frqpath,1005)
  269.     freturn=-1
  270.     cmp myhand,0,0,goto errfnf
  271.     close(myhand)
  272.     txtptr=exist
  273.     gosub print3d
  274.     goto prii5a
  275.  
  276. #i "Params:WINHAND"
  277.